<HTML>
<HEAD>
<TITLE>Mars Maps</TITLE>
</head>

<body>

<center>
<h1>BOI 2001 Day 2 Problem 2</h1>
<h1>Mars Maps</h1>
</center>

<p>
In the year 2051, several Mars expeditions have explored  different areas of the red planet and produced maps of these areas.
Now, the BaSA (Baltic Space Agency) has an ambitious plan:  they would like to produce a map of the whole planet.
In order to calculate the necessary effort, they need   to know the total size of the area for which maps already exist.
It is your task to write a program that calculates this area.

<h2>Task</h2>
Write a program that:
<ul>  
<li> reads the description of map shapes from the input file  <tt>mar.in</tt>,    
<li> computes the total area covered by the maps,   
<li> writes the result to the output file <tt>mar.out</tt>.
</ul>

<h2>Input</h2>
The input file <tt>mar.in</tt> starts with a line containing a  single integer <i>N</i> (<i>1&lt;=N&lt;=10&nbsp;000</i>), the number of available maps.
Each of the following <i>N</i> lines describes a map.
Each of these lines contains four integers <i>x<sub>1</sub></i>, <i>y<sub>1</sub></i>, <i>x<sub>2</sub></i>  and <i>y<sub>2</sub></i>  (<i>0&lt;=x<sub>1</sub>&lt;x<sub>2</sub>&lt;=30&nbsp;000</i>, <i>0&lt;=y<sub>1</sub>&lt;y<sub>2</sub>&lt;=30&nbsp;000</i>).
The values <i>(x<sub>1</sub>,y<sub>1</sub>)</i> and <i>(x<sub>2</sub>,y<sub>2</sub>)</i> are the coordinates of,  respectively,  the bottom-left and the top-right corner of the mapped area.
Each map has rectangular shape, and its sides are parallel to the  <i>x</i>- and <i>y</i>-axis of the coordinate system.

<h2>Output</h2>
The output file <tt>mar.out</tt> should contain one integer <i>A</i>,  the total explored area (i.e.
the area of the union of all rectangles).

<h2>Sample Input</h2>
<pre>
2
10 10 20 20
15 15 25 30
</pre>

<h2>Sample Output</h2>
<pre>
225
</pre>

<img src="image/42.gif">
</body>
</html>    
